var g_item_count = 0;

function add_item() {
    var para = document.createElement("p");
    para.setAttribute("id", "item_"+g_item_count);
    var choose_box = document.createElement("input");
    choose_box.setAttribute("type", 'checkbox');
    var select_class = document.createElement("select");
    var option_class_1 = document.createElement("option");
    option_class_1.appendChild(document.createTextNode("A股"));
    option_class_1.setAttribute("value", "A_stock");
    select_class.appendChild(option_class_1);
    
    var select_subclass = document.createElement("select");
    var option_subclass_1 = document.createElement("option");
    option_subclass_1.appendChild(document.createTextNode("行业"));
    select_subclass.appendChild(option_subclass_1);

    var expression = document.createElement("input");
    expression.style.width = "50%"
    var check_btn = document.createElement("button");
    check_btn.innerHTML = "检查";
    check_btn.addEventListener("click", check_expression);

    para.appendChild(choose_box);
    para.appendChild(select_class);
    para.appendChild(select_subclass);
    para.appendChild(expression);
    para.appendChild(check_btn);
    

    var element = document.getElementById("items");
    element.appendChild(para);
    g_item_count++;
    console.log("item_count:", g_item_count);
}

var a = new Array();
for (var i=0; i<10; i++)
    a.push(i)

function save_to_txt() {
    alert('save!')
}

function run_pie_chart() {
    alert('pp!')
}

function check_expression() {
    alert("cc")
}